﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
using System.Net;
public partial class BackGround_DetailInfo : System.Web.UI.Page
{
    Operation operation = new Operation();
    string infoid;
    string infotype="";
    string searchtype = "企业用户";
    
    protected void Page_Load(object sender, EventArgs e)
    {
       //Response.Write(Request.QueryString["id"].ToString() + "   " + Request.QueryString["type"].ToString());
        infoid = Request.QueryString["id"].ToString();
        
        if (!IsPostBack)
        {
            try
            {
                //infotype = Request.QueryString["type"].ToString();
                //DataSet ds = operation.SelectInfo(infotype, Convert.ToInt32(infoid));
                DataSet ds = operation.SelectInfo(Convert.ToInt32(infoid));
                txtType.Text = ds.Tables[0].Rows[0][1].ToString();
                txtTitle.Text = ds.Tables[0].Rows[0][2].ToString();
                txtInfo.Text = ds.Tables[0].Rows[0][3].ToString();
                txtLinkMan.Text = ds.Tables[0].Rows[0][4].ToString();
                txtTel.Text = ds.Tables[0].Rows[0][5].ToString();
                date.Text = ds.Tables[0].Rows[0][7].ToString();
                if (ds.Tables[0].Rows[0][6].ToString().CompareTo("False") == 0)
                {
                    checkBt.Text = "审核通过";
                    rcm.Enabled = false;
                }
                else
                {
                    checkBt.Text = "取消审核";
                }
                this.notXQInfoPanel.Visible = true;
                this.XQInfoPanel.Visible = false;
                if (txtType.Text.IndexOf("需求") != -1)
                {
                    this.notXQInfoPanel.Visible = false;
                    this.XQInfoPanel.Visible = true;
                    lbPrjMan.Text = ds.Tables[0].Rows[0][4].ToString();
                    lbPrjName.Text = ds.Tables[0].Rows[0][2].ToString();
                    lbWayReq.Text = ds.Tables[0].Rows[0][3].ToString();
                    lbTel.Text = ds.Tables[0].Rows[0][5].ToString();
                    lbComName0.Text = ds.Tables[0].Rows[0][10].ToString();
                    lbDept.Text = ds.Tables[0].Rows[0][11].ToString();
                    lbRanks.Text = ds.Tables[0].Rows[0][12].ToString();
                    lbAddress0.Text = ds.Tables[0].Rows[0][13].ToString();
                    lbPostCode.Text = ds.Tables[0].Rows[0][14].ToString();
                    lbPhone.Text = ds.Tables[0].Rows[0][15].ToString();
                    lbFx.Text = ds.Tables[0].Rows[0][16].ToString();
                    lbEmail.Text = ds.Tables[0].Rows[0][17].ToString();
                    lbProblem.Text = ds.Tables[0].Rows[0][18].ToString();
                    lbComInfo.Text = ds.Tables[0].Rows[0][19].ToString();
                    lbNewPrd.Text = ds.Tables[0].Rows[0][20].ToString();
                    lbWill.Text = ds.Tables[0].Rows[0][21].ToString();
                }
            }
            catch (Exception ex) {  }
              //GridViewBind(searchtype);
              //if(infotype.IndexOf("需求")!=-1)searchtype=
          }
      }
    

    protected void rcm_Click(object sender, EventArgs e)
    {
        string Src = "recommend.aspx?id=" + infoid;
        Response.Write("<script language='javascript' type='text/javascript'>location.href='" + Src + "'</script>");
    }


    protected void lkBtBack_Click(object sender, EventArgs e)
    {
        string Src = "CheckInfo.aspx?id=" + txtType.Text;
        Response.Redirect(Src);
        //Response.Write("<script language='javascript' type='text/javascript'>location.href='" + Src + "'</script>");
    }
    protected void check_Click(object sender, EventArgs e)
    {
        //Response.Redirect("CheckInfo.aspx?id=" + txtType.Text);
        if (checkBt.Text.CompareTo("审核通过") == 0)
        {
            rcm.Enabled = true;
            checkBt.Text = "取消审核";
        }
        else
        {
            rcm.Enabled = false;
            checkBt.Text = "审核通过";
        }
        operation.UpdateInfo(infoid, txtType.Text);
    }
}
